package com.power.sifa.correction.model.enumeration;

import lombok.Getter;

/**
 * @ClassName Tp_crc_ruleEnum
 * @Author xiongzw
 * @Date 2023/12/11 18:47
 * @Description 规则枚举
 * @Version: 1.0
 **/

@Getter
public enum Tp_crc_ruleEnum {


    ZONE_OUT_RULE(Tp_crc_rule.ZONEOUT, "出圈规则","出圈规则"),
    ZONE_IN_RULE(Tp_crc_rule.ZONEIN, "入圈规则","入圈规则"),
    // FEAT: 同案犯规则去除，保留避免后续撤回
//    SAME_CASE_RULE(Tp_crc_rule.SAMECASE, "同案犯聚集规则","同案犯聚集规则"),
    NIGHT_OUT_RULE(Tp_crc_rule.NIGHTOUT, "夜间外出规则","夜间外出规则");


    /**
     * 规则分类id
     */
    private Integer id;

    /**
     * 规则分类名称
     */
    private String name;

    /**
     * 规则描述
     */
    private String desc;

    Tp_crc_ruleEnum(Integer id, String name, String desc) {
        this.id = id;
        this.name = name;
        this.desc = desc;
    }

    public static Tp_crc_ruleEnum getById(Integer id) {
        Tp_crc_ruleEnum[] ruleEnums = Tp_crc_ruleEnum.values();
        for (Tp_crc_ruleEnum rule : ruleEnums) {
            if (rule.getId().equals(id)) {
                return rule;
            }
        }
        return null;
    }

}
